﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using OnTheWay;

namespace Models
{
    public enum ExhibitUnitTypeEnum
    {
        图片, 视频
    }

    [DataBaseTable]
    public class ExhibitUnit : OnTheWay.Models.Model
    {
        /// <summary>
        /// 排序
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(int),Detail="排序")]
        public virtual int Sort { get; set; }
        /// <summary>
        /// Exhibit 关联 ID
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(Guid), NotNullable = true)]
        public virtual Guid ExhibitID { get; set; }
        /// <summary>
        /// 是否水平布局（针对图片）
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(bool), NotNullable = true)]
        public virtual bool IsHorizontal { get; set; }
        /// <summary>
        /// 封面图片（针对视频）
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(string), Detail = "视频封面", NotNullable = false)]
        public virtual string MooMaUrl { get; set; }
        /// <summary>
        /// 图片连接
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(string), Detail = "图片内容", NotNullable = true)]
        public virtual string UnitUrls { get; set; }
        /// <summary>
        /// 详细描述
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(string), Detail = "详细描述", NotNullable = false)]
        public virtual string Description { get; set; }
        /// <summary>
        /// 作者
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(string), Detail = "作者", NotNullable = false, Length = 64)]
        public virtual string Author { get; set; }
        /// <summary>
        /// 分类 ExhibitUnitTypeEnum
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(int), Detail = "分类", NotNullable = true)]
        public virtual int Type { get; set; }

        /// <summary>
        /// 分类枚举
        /// </summary>
        public virtual ExhibitUnitTypeEnum TypeEnum
        {
            get { return (ExhibitUnitTypeEnum)Type; }
            set { Type = (int)value; }
        }

        public ExhibitUnit()
        {
            this.Author = String.Empty;
            this.Description = String.Empty;
            this.MooMaUrl = String.Empty;
            this.UnitUrls = String.Empty;
        }
    }
}
